const Model = require("../../models");

module.exports = {
  name: "department_disease",

  async init_data() {
    try {
      const model = Model.models.department_and_disease;
      if (await model.is_data_initial()) return;
      const data = model.get_initial_data();
      await model.core.bulkCreate(data);
      return { ok: 1 };
    } catch (e) {
      console.log(e);
      return { ok: 0 };
    }
  },

  async get_department_disease() {
    try {
      const model = Model.models.department_and_disease;
      const data = await model.get_department_disease();
      return { ok: 1, data };
    } catch (e) {
      console.log(e);
      return { ok: 0, err: "获取出错" };
    }
  },
};
